package com.eorchis.module.trainingneeds.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;


import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;

/**
 * Title: QuestionnaireQuestion<br>
 * Description: 问卷试题关系表实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author HuangTF
 * @createDate 2014-02-18
 * @version $Revision$
 */
@Entity
@Table(name = "QUESTIONNAIRE_QUESTION")
public class QuestionnaireQuestion extends AbstractBaseEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	/**
	 * 是否必填：是
	 */
	public final static Integer IS_MUST_Y = new Integer(1);
	/**
	 * 是否必填：否
	 */
	public final static Integer IS_MUST_N = new Integer(2);
	
	private String questionnaireQuestionId;//问卷试题关系ID
	private Questionnaire questionnaire;//问卷
	private QuestionBank questionBank;//试题
	private Integer isMust;//是否必填
	private Integer orderNum;//试题题号
	/**
	 * 获取问卷试题关系ID
	 */		
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="QUESTIONNAIRE_QUESTION_ID")
	public String getQuestionnaireQuestionId() {
		return questionnaireQuestionId;
	}
	/**
	 * 设置问卷试题关系ID
	 */		
	public void setQuestionnaireQuestionId(String questionnaireQuestionId) {
		this.questionnaireQuestionId = questionnaireQuestionId;
	}
	
	/**
	 *  获取问卷
	 */		
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="QUESTIONNAIRE_ID")
	public Questionnaire getQuestionnaire() {
		return questionnaire;
	}
	/**
	 * 设置问卷
	 */		
	public void setQuestionnaire(Questionnaire questionnaire) {
		this.questionnaire = questionnaire;
	}
	/**
	 * 获取试题
	 */		
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="QUESTION_ID")
	public QuestionBank getQuestionBank() {
		return questionBank;
	}
	/**
	 * 设置试题
	 */		
	public void setQuestionBank(QuestionBank questionBank) {
		this.questionBank = questionBank;
	}
	/**
	 * 获取是否必填
	 */		
	@Column(name="IS_MUST")
	public Integer getIsMust() {
		return isMust;
	}
	/**
	 * 设置是否必填
	 */		
	public void setIsMust(Integer isMust) {
		this.isMust = isMust;
	}
	
	/**
	 * 获取试题题号
	 */		
	@Column(name="ORDER_NUM")
	public Integer getOrderNum() {
		return orderNum;
	}
	/**
	 * 设置试题题号
	 */		
	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "";
	}
}
